package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "溺毙之环")
@Order(100)
@Component
public class NiBiZhiHuan extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        battleHelper.autoAction(this, first, second, content, (int) (first.getBattleInfo().getSpell()*2.5), "溺毙之环");
        first.getCd().put("溺毙之环", 4);
    }

    @Override
    public void limit(UserBO user) {}

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return "极纯的水元素凝结成的生命体,水之亲眷，怀着已殁之神的碎片,凝聚出的水环\n造成2.5倍法攻的真实伤害，cd4回合，战斗5回合后可释放";
    }

    @Override
    public boolean check(UserBattleContent user, BattleContent content) {
        if(content.getTurn() < 5){
            return false;
        }
        Integer cd = user.getCd().get("溺毙之环");
        if (cd != null && cd > 0) {
            return false;
        }
        return true;
    }


}
